package com.wwl.deliveryappointmentbackend.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wwl.deliveryappointmentbackend.mapper.DeliverMapper;
import com.wwl.deliveryappointmentbackend.model.Deliver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DeliverService {
    @Autowired
    private DeliverMapper deliverMapper;

    public IPage<Deliver> findByOpenid(String openid,int pageNum, int pageSize) {
        // 创建分页对象
        Page<Deliver> page = new Page<>(pageNum, pageSize);
        // 执行分页查询
        return deliverMapper.findByOpenid(page,openid);
    }
    public void saveDeliver(Deliver deliver) {
        deliverMapper.insert(deliver);
    }
}
